package com.hengtuo.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.hengtuo.base.BaseFragment;
import com.hengtuo.kaiyuanzhongguo.ExerciseActivity;
import com.hengtuo.kaiyuanzhongguo.FinderActivity;
import com.hengtuo.kaiyuanzhongguo.FriendsActivity;
import com.hengtuo.kaiyuanzhongguo.R;
import com.hengtuo.kaiyuanzhongguo.ScanActivity;
import com.hengtuo.kaiyuanzhongguo.SharkActivity;

/**
 * 发现
 */
public class Find_Fragment extends BaseFragment implements View.OnClickListener{

//    View view;
    private RelativeLayout friend;
    private RelativeLayout finder;
    private RelativeLayout activity;
    private RelativeLayout scan;
    private RelativeLayout shark;

    //查找布局
    @Override
    protected int getLoadViewId() {
        return R.layout.f3;
    }
    //查找控件
    @Override
    protected void initView(View view) {
        friend = (RelativeLayout) view.findViewById(R.id.f3_find_friend);
        finder = (RelativeLayout) view.findViewById(R.id.f3_find_finder);
        activity = (RelativeLayout) view.findViewById(R.id.f3_find_activity);
        scan = (RelativeLayout) view.findViewById(R.id.f3_find_scan);
        shark = (RelativeLayout) view.findViewById(R.id.f3_find_shark);

    }
    //主方法
    @Override
    protected void initData() {
        friend.setOnClickListener(this);
        finder.setOnClickListener(this);
        activity.setOnClickListener(this);
        scan.setOnClickListener(this);
        shark.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.f3_find_friend:// 好友圈
                Intent it = new Intent(getActivity(),FriendsActivity.class);
                startActivity(it);

                break;
            case R.id.f3_find_finder:// 找人
                Intent it1 = new Intent(getActivity(),FinderActivity.class);
                startActivity(it1);

                break;
            case R.id.f3_find_activity:// 活动
                Intent it2 = new Intent(getActivity(),ExerciseActivity.class);
                startActivity(it2);

                break;
            case R.id.f3_find_scan:// 扫一扫
                Toast.makeText(getActivity(), "扫一扫", Toast.LENGTH_SHORT).show();
                Intent it3 = new Intent(getActivity(),ScanActivity.class);
                startActivity(it3);
                break;
            case R.id.f3_find_shark:// 摇一摇
                Intent it4 = new Intent(getActivity(),SharkActivity.class);
                startActivity(it4);
                break;

        }
    }
}
